MapRgn
MapRgn
Scale and reposition a region RgnHandle theRgn ; handle leading to region to map Rect *destRect ; address of Rect to convert to MapRgn resizes and re positions a region, converting its coordinates by a size ratio and offset of two rectangles. Use this to scale and reposition a region.
theRgn is a handle leading to a variable-length Region structure. On entry, it describes a region within srcRect that you wish to remap. Upon return, all its coordinates have been recalculated relative to the size
and position of destRect .
destRect are the addresses of two 8-byte Rect structures. For typical operations, theRgn is enclosed by srcRect . It gets mapped to a similar position within destRect .
Notes: Use this function to resize and reposition a region that you wish to expand
or shrink as you move it from one rectangular area to another (typically
smaller or larger) one:
theRgn is expanded or shrunk by the ratio of the sizes of srcRect and destRect. It is moved to a similarly-located position within destRect . This
is a purely mathematical operation and has no effect on the screen unless
theRgn is subsequently drawn or filled.
This function is preferable to InsetRgn since the region retains its shape, scaled by the ratio of the rectangles. No information is lost; the region may
be remapped back to its original size.